﻿using FurionApi.Demo.Application.Cache.Enum;
using Microsoft.Extensions.Caching.Distributed;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FurionApi.Demo.Application.Cache.Services
{
    public interface ISysCacheService
    {
        IDistributedCache Cache { get; }
        Task<T> GetAsync<T>(string cacheKey);
        Task<string> GetStringAsync(string cacheKey);
        Task SetStringAsync(string cacheKey, string str, int timeOutSecond = 0, TimeOutType timeOutType = TimeOutType.Sliding);
        Task SetAsync(string cacheKey, object value, int timeOutSecond = 0, TimeOutType timeOutType = TimeOutType.Sliding);
        Task RemoveAsync(string key);
    }
}
